<?php
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\CheckSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
use yii\helpers\Url;
$this->title = '特尊医疗管理后台';
?>
    <section class="app-page-section">
    
        <menu class="app-admin-menu">
            <a href="<?= Url::toRoute(['manage/check']) ?>" <?php if(empty($type)) { ?>class="active"<?php } ?>><span>全部</span></a>
            <a href="<?= Url::toRoute(['manage/check', 'type' => 2]) ?>" <?php if($type == 2 ) { ?>class="active"<?php } ?>><span>申请中</span></a>
            <a href="<?= Url::toRoute(['manage/check', 'type' => 1]) ?>" <?php if($type == 1) { ?>class="active"<?php } ?>><span>申请成功</span></a>
            <a href="<?= Url::toRoute(['manage/check', 'type' => 3]) ?>" <?php if($type == 3) { ?>class="active"<?php } ?>><span>申请失败</span></a>
        </menu>

	   	<section class="app-container app-member app-admin">
            <div class="app-tab-content active">
                <div class="app-admin-buy-list">
    
                    <?php
                    foreach($dataProvider->getModels() as $k => $model) {
                    /** @var \common\models\Check $model */
                    ?>
                    <div class="app-admin-buy-item">
                        <div class="clearfix">
                            <strong class="name pull-left"><?= $model->user->username ?></strong>
                            <?php
                            if( $model->times === 3 ){
                                ?>
                                <span class="status status-success pull-right">已通过</span>
                                <?php
                            }elseif( $model->times === -1 ){
                            ?>
                                <span class="status status-fail pull-right">未通过</span>
                            <?php
                            } else{
    
                                ?>
                                <span class="status status-warring pull-right">审核中</span>
                                <?php
                            }
                            ?>
                        </div>
                        <div class="clearfix">
                            <span class="tel pull-left"><?= $model->user->mobile ?></span>
                            <span class="time pull-right"><?= date('Y-m-d H:i:s', $model->created_at) ?></span>
                        </div>
                        <div class="app-admin-buy-control text-right">
                            <a href="<?= Url::toRoute(['manage/check-info', 'id' => $model->id]) ?>">查看详情</a>
                        </div>
                    </div>
                    <?php
                    }
                    ?>
                    
                </div>
            </div>
            

        </section>

    </section>
